﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<script runat="server">

protected void  Page_Load(object sender, EventArgs e)
{

}
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	search
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <%using (Html.BeginForm("search", "Search"))
      { %>
    <input id="Text"  name ="Text" type="text" value="<%=ViewData["Text"] %>" />
    <input id="Submit" type="submit" value="搜索" />
    <div>
     <h5>
    <input id="TypeBolg" name="SearchType" type="radio" <% if(ViewData["Type"]=="bolg")Response.Write("checked=\"checked\""); %>/>
    <label >博客</label>
    <input id="TypeAsticle" name="SearchType" type="radio" <% if(ViewData["Type"]=="article")Response.Write("checked=\"checked\""); %>/>
    <label >文章</label>
    </h5>
    </div>
    <%} %>
    <div>
    <% var Result =ViewData ["result"] as List<MvcApplication1.Models.searchresult>%>
    <% if (Result!=null)
           if (Result.Count() == 0)
           {
               Html.Encode("没有搜索结果");
           } 
           else
           { %>
            <ul>

            <% foreach (MvcApplication1.Models.searchresult ResultEntity in Result) {%>
            <li>
            <table style="width: 100%;">
             <tr>
             <td style="width: 104px">
            <img src="../../Image/头像.jpg" style="height: 108px; width: 115px" />                       <%--"<% =ResultEntity.imgsrc %>" />--%>
            </td>
            <td style="width: 441px">
            <div>
            <h5><label>博客名: </label></h5>
            <label><%=ResultEntity.bolgname%>
            </div>
            <div>
            <h5><label>关注度 :</label></h5>
            </div>
            <label><% =ResultEntity.bolgfoucsed %>
            <div align="center">
            <input id="<%=ResultEntity.bolgname %>"type="button" value="关注" />
            </div>
             </td>
            
            </tr>
            </table>
            </li>
            <%} %>

            </ul>

                
                
                
               

    </div>


</asp:Content>
